; Test out the port and asm features

; Some NES ports
export port ppuControl = $2000
export port ppuMask = $2001
export port apuDmcFrequencey = $4010
export port apuFrameCounter = $4017

export sub main
	; Init code
	apuFrameCounter = $40
	apuDmcFrequencey = 0
	ppuControl = 0
	ppuMask = 0
	
	; Assembly block to clear RAM
	asm
		ldx #$00
		loop:
			lda #$ff	; Page $02 needs to be cleared to $FF to force OAM data
			sta	$0200,x	; off-screen. Change this page if you don't use $02 for
			lda #$00	; the OAM DMA buffer.
			sta $0000,x
			sta $0100,x
			sta $0300,x
			sta $0400,x
			sta $0500,x
			sta $0600,x
			sta $0700,x
			dex
			bne	loop
	end asm
end sub

export sub frame
end sub

export sub interrupt
end sub
